package com.stark.commons.spring.core.support.aop;

import java.lang.reflect.Method;

import org.springframework.util.Assert;

import lombok.Data;

/**
 * 作用于<strong>方法上</strong>的注解的根元素。
 * <p>支持 <code>#root.targetClass</code> 、<code>#root.methodName</code> 等。
 * @author Ben
 * @since 1.0.0
 * @version 1.0.0
 */
@Data
public class MethodExpressionRootObject {

	private final Method method;
	
	private final String methodName;

	private final Object[] args;

	private final Object target;

	private final Class<?> targetClass;

	public MethodExpressionRootObject(Method method, Object[] args, Object target, Class<?> targetClass) {
		Assert.notNull(method, "Method is required");
		Assert.notNull(targetClass, "targetClass is required");
		this.method = method;
		this.methodName = method.getName();
		this.target = target;
		this.targetClass = targetClass;
		this.args = args;
	}

}
